﻿@{
    ViewBag.Title = "Modificar";
}

<h2>Modificar</h2>



@{
    string[] names = Enum.GetNames(typeof(LocalElectrodomesticos.Controllers.Categoria));    

}

<form action="/Local/Modificar" method="post">
<input type="hidden" name="pos" value="@ViewBag.pos" />
<label>
    <span>Nombre</span>
    <input type="text" name="nombre" value="@Model.nombre" />
</label>
<br />
<label>
    <span>Marca</span>
    <input type="text" name="marca" value="@Model.marca" />
</label>
<br />
<label>
    <span>Precio</span>
    <input type="number" name="precio" value="@Model.precio" />
</label>
<br />
<label>
<span>Categoria</span>
<select name="categoria">
@for (int i = 0; i<names.Length; i++) 
{
    var s = names[i];
    if (i == (int)Model.categoria)
    {
        <option value="@i" selected="selected">@s</option> 
    }
    else
    {
        <option value="@i">@s</option>          
    }
}
</select>
</label>
<input type="submit" />
</form>